<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/6/30
  Time: 19:40
  To change this template use File | Settings | File Templates.
--%>
<%--5:记录某个jsp被访问的次数（用jsp声明）--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>访问次数</title>
</head>
<body>
<%!
    int count = 0;

    synchronized void count() {
        count++;
    }
%>
<% count();
    out.println("这是第" + count + "个访问者!");
%>
</body>
</html>
